import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 用户uid
    urseuid: 475568164,
    // 登录显示隐藏
    isLoginShow: false,
    // 控制提示组件显示隐藏
    tixingShow: {
      show: false,
      tixingText: ''
    },
    // 用户头像
    avatarUrl: '',
    // 用户头像和登录切换
    isGoLogin: true,
    // 歌手页面
    // 歌手list
    rzgslist: [],
    // 歌手名字
    geshouname: [],
    // 歌单详情
    gedanxq: [],
    // 歌曲url
    musesrc: null
  },
  getters: {
  },
  mutations: {
    // 歌曲url 
    Channegequrul(state, payload) {
      state.musesrc = payload
    },
    // 歌单详情修改
    Channegedanxq(state, payload) {
      state.gedanxq = payload
    },
    // 修改用户uid
    Channeurseuid(state, payload) {
      state.urseuid = payload
    },
    // 歌手页面
    Channerzgslist(state, payload) {
      state.rzgslist = payload
    },
    // 歌手名字
    CHannergeshouname(state, payload) {
      state.geshouname = payload
    },
    // 用户头像登录切换
    ChanneisGoLogin(state, payload) {
      state.isGoLogin = payload
    },
    // 控制登录显示隐藏
    ChanneLogin(state, payload) {
      state.isLoginShow = payload
    },
    // 控制提示组件显示隐藏
    Channetixing(state, payload) {
      state.tixingShow = payload
    },
    // 修改用户头像
    ChanneavatarUrl(state, payload) {
      state.avatarUrl = payload
    }
  },
  actions: {
    Channetixingee(state, payload) {
      state.commit('Channetixing', payload)
      setTimeout(() => {
        state.commit('Channetixing', {
          show: false,
          tixingText: ''
        })
      }, 2000);
    }
  },
  modules: {
  }
})
